package com.yangle.frame.common.controller;

import com.yangle.frame.admin.entity.FrameCodeItem;
import com.yangle.frame.admin.entity.FrameMenu;
import com.yangle.frame.admin.service.FrameMenuService;
import com.yangle.frame.common.utils.EhcacheUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * Created by yangle on 2018/5/26.
 */
@Controller
@RequestMapping("/common")
public class CommonController {
    @Autowired
    private EhcacheUtils ehcacheUtils;
    @RequestMapping("/fontChose")
    public String fontChose(){

        return "common/font_chose";
    }

@ResponseBody
@RequestMapping("/getModelJson")
    public Map<String,Object> getModelJson(String model){
    List<FrameCodeItem> codeItems= (List<FrameCodeItem>) ehcacheUtils.get(model);
    Map<String,Object> map=new HashMap<>();
    map.put("code",codeItems);
        return map;
}
}